//package com.user.config;
//
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.security.config.annotation.web.builders.HttpSecurity;
//import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
//import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
//import org.springframework.security.crypto.password.PasswordEncoder;
//
////@Configuration
//public class SecurityConfig extends WebSecurityConfigurerAdapter {
//
//    @Override
//    protected void configure(HttpSecurity http) throws Exception {
//        //自定义登录页面
//        http.formLogin()
//                .loginPage("/login.html")
//                //必须和表单提交的接口一样
//                .loginProcessingUrl("/user/login")
//                .successForwardUrl("/main.html");
//
//        //授权
//        http.authorizeRequests()
//                //放行logim.html,不需要认证
//                .antMatchers("/login.html").permitAll()
//                //所有请求都必须认证才能访问，必须登录
//                .anyRequest().authenticated();
//
//        http.csrf().disable();
//    }
//
////    @Bean
//    public PasswordEncoder getPassword(){
//        return new BCryptPasswordEncoder();
//    }
//
//}
